function showDialog (element) {
	 var oDiv = $('<div></div>')
	 	.attr('class','dialog')
	 	.css({
	 		position: 'fixed',
	 		display: 'inline-block',
	 		zIndex: '9999',
	 		display: 'none',
	 		top: '0px',
	 		left: '0px'
	 	});
	 
	 var data = $('<table></table>').html(
	 	'<tbody>'+
		 	'<tr>'+
			 	'<td class="tl"></td>'+
			 	'<td class="t close"><a href="/" onclick="hideDialog(); return false;">закрыть</a></td>'+
			 	'<td class="tr"></td>'+
		 	'</tr>'+
		 	'<tr>'+
			 	'<td class="l"></td>'+
			 	'<td class="content">'+$(element).html()+'</td>'+
			 	'<td class="r"></td>'+
		 	'</tr>'+
		 	'<tr>'+
			 	'<td class="bl"></td>'+
			 	'<td class="b"></td>'+
			 	'<td class="br"></td>'+
		 	'</tr>'+
	 	'</tbody>'
	 );
	 
	 data.attr('class','dialog_table').attr('cellspacing','0').attr('cellpadding','0');
	 
	 $(document.body).append(oDiv.append(data));
	 
	 oDiv.show();
	 
	 oDiv.css({
	 	left: ($(window).width()/2-$(oDiv).width()/2)+'px',
	 	top: ($(window).height()/2-$(oDiv).height()/2)+'px'
	 });
}

function hideDialog () {
	$('.dialog').remove();
}

function updateDialogPosition () {
	$('.dialog').css({
	 	left: ($(window).width()/2-$('.dialog').width()/2)+'px',
	 	top: ($(window).height()/2-$('.dialog').height()/2)+'px'
	 });
}